package com.lwj.liwanjia.model;

import com.google.gson.Gson;
import com.lwj.liwanjia.api.ApiService;
import com.lwj.liwanjia.bean.DeleteAllBean;
import com.lwj.liwanjia.bean.DeleteBean;
import com.lwj.liwanjia.utils.RetrofitHelper;

import java.util.List;
import java.util.Map;

import okhttp3.RequestBody;
import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

/**
 * Created by Administrator on 2017/10/2.
 */

public class DeleteGwcModel {
    public void deleteGwc(String token, DeleteAllBean deleteAllBean, Subscriber<DeleteBean> subscriber) {
        Gson gson = new Gson();
        String json = gson.toJson(deleteAllBean);
        RequestBody body = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), json);
        RetrofitHelper.getSingleRetrofit()
                .create(ApiService.class)
                .deleteGwc(token, body)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(subscriber);
    }
}
